<html>
<head>
<title>TestNG:  Mocks</title>
<link href="../testng.css" rel="stylesheet" type="text/css" />
<link href="../my-testng.css" rel="stylesheet" type="text/css" />

<style type="text/css">
.log { display: none;} 
.stack-trace { display: none;} 
</style>
<script type="text/javascript">
<!--
function flip(e) {
  current = e.style.display;
  if (current == 'block') {
    e.style.display = 'none';
    return 0;
  }
  else {
    e.style.display = 'block';
    return 1;
  }
}

function toggleBox(szDivId, elem, msg1, msg2)
{
  var res = -1;  if (document.getElementById) {
    res = flip(document.getElementById(szDivId));
  }
  else if (document.all) {
    // this is the way old msie versions work
    res = flip(document.all[szDivId]);
  }
  if(elem) {
    if(res == 0) elem.innerHTML = msg1; else elem.innerHTML = msg2;
  }

}

function toggleAllBoxes() {
  if (document.getElementsByTagName) {
    d = document.getElementsByTagName('div');
    for (i = 0; i < d.length; i++) {
      if (d[i].className == 'log') {
        flip(d[i]);
      }
    }
  }
}

// -->
</script>

</head>
<body>
<h2 align='center'>Mocks</h2><table border='1' align="center">
<tr>
<td>Tests passed/Failed/Skipped:</td><td>4/1/0</td>
</tr><tr>
<td>Started on:</td><td>Wed Nov 22 10:31:15 CST 2017</td>
</tr>
<tr><td>Total time:</td><td>0 seconds (558 ms)</td>
</tr><tr>
<td>Included groups:</td><td></td>
</tr><tr>
<td>Excluded groups:</td><td></td>
</tr>
</table><p/>
<small><i>(Hover the method name to see the test class name)</i></small><p/>
<table width='100%' border='1' class='invocation-failed'>
<tr><td colspan='4' align='center'><b>FAILED TESTS</b></td></tr>
<tr><td><b>Test method</b></td>
<td width="30%"><b>Exception</b></td>
<td width="10%"><b>Time (seconds)</b></td>
<td><b>Instance</b></td>
</tr>
<tr>
<td title='org.quickstart.testng.samples.EmployeeDirectoryTest.checkFirstNameFunction()'><b>checkFirstNameFunction</b><br>Test class: org.quickstart.testng.samples.EmployeeDirectoryTest</td>
<td><div><pre>org.mockito.exceptions.verification.TooManyActualInvocations: 
iPerson.getFullName();
Wanted 1 time:
-&gt; at org.quickstart.testng.samples.EmployeeDirectoryTest.checkFirstNameFunction(EmployeeDirectoryTest.java:63)
But was 2 times. Undesired invocation:
-&gt; at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)

	at org.quickstart.testng.samples.EmployeeDirectoryTest.checkFirstNameFunction(EmployeeDirectoryTest.java:63)
... Removed 25 stack frames</pre></div><a href='#' onClick='toggleBox("stack-trace548554586", this, "Click to show all stack frames", "Click to hide stack frames")'>Click to show all stack frames</a>
<div class='stack-trace' id='stack-trace548554586'><pre>org.mockito.exceptions.verification.TooManyActualInvocations: 
iPerson.getFullName();
Wanted 1 time:
-&gt; at org.quickstart.testng.samples.EmployeeDirectoryTest.checkFirstNameFunction(EmployeeDirectoryTest.java:63)
But was 2 times. Undesired invocation:
-&gt; at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)

	at org.quickstart.testng.samples.EmployeeDirectoryTest.checkFirstNameFunction(EmployeeDirectoryTest.java:63)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
	at org.testng.TestRunner.privateRun(TestRunner.java:744)
	at org.testng.TestRunner.run(TestRunner.java:602)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
	at org.testng.SuiteRunner.run(SuiteRunner.java:289)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
	at org.testng.TestNG.runSuites(TestNG.java:1144)
	at org.testng.TestNG.run(TestNG.java:1115)
	at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
</pre></div></td>
<td>0</td>
<td>org.quickstart.testng.samples.EmployeeDirectoryTest@1d8d30f7</td></tr>
</table><p>
<table width='100%' border='1' class='invocation-passed'>
<tr><td colspan='4' align='center'><b>PASSED TESTS</b></td></tr>
<tr><td><b>Test method</b></td>
<td width="30%"><b>Exception</b></td>
<td width="10%"><b>Time (seconds)</b></td>
<td><b>Instance</b></td>
</tr>
<tr>
<td title='org.quickstart.testng.samples.EmployeeDirectoryTest.addPersonToEmployeeDirectory()'><b>addPersonToEmployeeDirectory</b><br>Test class: org.quickstart.testng.samples.EmployeeDirectoryTest</td>
<td></td>
<td>0</td>
<td>org.quickstart.testng.samples.EmployeeDirectoryTest@1d8d30f7</td></tr>
<tr>
<td title='org.quickstart.testng.samples.EmployeeDirectoryTest.checkFirstNameFunctionInvocation()'><b>checkFirstNameFunctionInvocation</b><br>Test class: org.quickstart.testng.samples.EmployeeDirectoryTest</td>
<td></td>
<td>0</td>
<td>org.quickstart.testng.samples.EmployeeDirectoryTest@1d8d30f7</td></tr>
<tr>
<td title='org.quickstart.testng.samples.EmployeeDirectoryTest.checkFirstPersonNameInTheDirectory()'><b>checkFirstPersonNameInTheDirectory</b><br>Test class: org.quickstart.testng.samples.EmployeeDirectoryTest</td>
<td></td>
<td>0</td>
<td>org.quickstart.testng.samples.EmployeeDirectoryTest@1d8d30f7</td></tr>
<tr>
<td title='org.quickstart.testng.samples.EmployeeDirectoryTest.shouldThrowExceptionWhenAccessingFirstPersonOnEmptyDirectory()'><b>shouldThrowExceptionWhenAccessingFirstPersonOnEmptyDirectory</b><br>Test class: org.quickstart.testng.samples.EmployeeDirectoryTest</td>
<td><div><pre>java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.rangeCheck(ArrayList.java:657)
	at java.util.ArrayList.get(ArrayList.java:433)
	at org.quickstart.testng.samples.EmployeeDirectory.getFirstPerson(EmployeeDirectory.java:24)
	at org.quickstart.testng.samples.EmployeeDirectoryTest.shouldThrowExceptionWhenAccessingFirstPersonOnEmptyDirectory(EmployeeDirectoryTest.java:73)
... Removed 25 stack frames</pre></div><a href='#' onClick='toggleBox("stack-trace530539368", this, "Click to show all stack frames", "Click to hide stack frames")'>Click to show all stack frames</a>
<div class='stack-trace' id='stack-trace530539368'><pre>java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.rangeCheck(ArrayList.java:657)
	at java.util.ArrayList.get(ArrayList.java:433)
	at org.quickstart.testng.samples.EmployeeDirectory.getFirstPerson(EmployeeDirectory.java:24)
	at org.quickstart.testng.samples.EmployeeDirectoryTest.shouldThrowExceptionWhenAccessingFirstPersonOnEmptyDirectory(EmployeeDirectoryTest.java:73)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
	at org.testng.TestRunner.privateRun(TestRunner.java:744)
	at org.testng.TestRunner.run(TestRunner.java:602)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
	at org.testng.SuiteRunner.run(SuiteRunner.java:289)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
	at org.testng.TestNG.runSuites(TestNG.java:1144)
	at org.testng.TestNG.run(TestNG.java:1115)
	at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
</pre></div></td>
<td>0</td>
<td>org.quickstart.testng.samples.EmployeeDirectoryTest@1d8d30f7</td></tr>
</table><p>
</body>
</html>